<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap.min.css">
	<script type="text/javascript" src='__PUBLIC__/js/jquery-3.1.1.min.js'></script>
	<script type="text/javascript" src='__PUBLIC__/js/bootstrap.min.js'></script>
	<style type="text/css">
   #bread{
            list-style-type: none;
            width: 100%;
            height: 80px;
            background-color: white;
        }
        #bread li{
            float: left;
        }
	#myTab li{
		margin-left: 265px;
    margin-top: 50px;
	}
  .red{color: red;font-weight: bold;font-size: 15px;margin-left: -80px;display: none;}
	</style>
</head>
<body>
<!--头顶开始-->
<nav class="navbar navbar-default" role="navigation"> 
    <div class="container-fluid"> 
        <div class="navbar-header"> 
            <a class="navbar-brand" href="#">同城二手交易平台</a> 
        </div> 
    <ul class="nav navbar-nav navbar-right">
    <empty name='user'>
            <li><a href="#" id="login_error"><span class="glyphicon glyphicon-log-in">&nbsp;</span>登录</a></li>
            <script type="text/javascript">
              $("#login_error").click(function(){
                location.href="http://localhost/exchange/index.php/Home/user";
              })
            </script>
            <else />
            <li><a href="#"><span class="glyphicon glyphicon-log-in">&nbsp;</span>{$user}</a></li>
    </empty>
    <empty name='user'>
            <li>
            <a href="#" id="register_error"><span class="glyphicon glyphicon-user">&nbsp;</span>注册</a>
            </li>
            <script type="text/javascript">
               $("#register_error").click(function(){
                location.href="http://localhost/exchange/index.php/Home/user";
              })
            </script>
            <else />
           <li> <a href="#"><span class="glyphicon glyphicon-user">&nbsp;</span>注册</a></li>
      </empty>
        </ul> 
    </div> 
</nav>
<!--头顶结束-->
<!--面包屑导航-->
<ul id="bread">
    <li><img src="__PUBLIC__/images/logo.png" style="width: 180px;height: 80px;cursor: pointer;" id="back"></li>
    <li style="font-size: 25px;height: 80px;line-height: 80px;">></li>
    <li style="font-size: 25px;height: 80px;line-height: 80px;">发布</li>
</ul>
<script type="text/javascript">
        $("#back").click(function(){
            window.location.href="http://localhost/exchange/";
        })
    </script>
<!--面包屑导航-->
<ul id="myTab" class="nav nav-tabs">
    <li class="active">
        <a href="#home" data-toggle="tab">
            发布二手精品
        </a>
    </li>
    <li>
         <a href="#ios" data-toggle="tab">发布求购信息
        </a>
    </li>
    <li>
         <a href="#test" data-toggle="tab">发布以物换物信息
        </a>
    </li>
</ul>
<div id="myTabContent" class="tab-content">
 <!--二手精品-->
    <div class="tab-pane fade in active" id="home">
 <form class="form-horizontal" role="form" action="publish/ershou" enctype="multipart/form-data" method="post">

 <div class="form-group" style="margin-left: 250px;">
    <label for="name" class="col-sm-2 control-label">商品类别</label>&nbsp;
    <select class="form-control col-sm-5" style="width: 500px;" name="kinds">
      <option value="数码产品">数码产品</option>
      <option value="家用电器">家用电器</option>
      <option value="二手车">二手车</option>
      <option value="图书音像">图书音像</option>
      <option value="工艺收藏">工艺收藏</option>
      <option value="乐器运动">乐器运动</option>
    </select>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">商品描述</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control" placeholder="例：九成新的红米note4X" name="desc">
    </div>
    <span class="red col-sm-2 control-label">描述不能为空</span>
  </div><br>


   <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">价格</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="1500" name="price">
    </div>
    <span class="red col-sm-2 control-label">价格不能为空</span>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">地区</label>
    <select class="form-control" style="width: 500px;" name="area">
      <option value="桥西区">桥西区</option>
      <option value="裕华区">裕华区</option>
      <option value="长安区">长安区</option>
      <option value="桥东区">桥东区</option>
      <option value="新华区">新华区</option>
      <option value="正定区">正定区</option>
    </select>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">详细地址</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="例：裕翔街26号" name="detail">
    </div>
    <span class="red col-sm-2 control-label">地址不能为空</span>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">联系方式</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="例：15732136925" name="contract">
    </div>
    <span class="red col-sm-2 control-label" style="margin-left: -30px;">联系方式不能为空</span>
  </div><br>


  <div class="form-group" align="center">
  		<input type="file" id="inputfile" name="file">
  </div><br>
  <button type="submit" class="btn btn-default" style="margin-left: 500px;" id="ershou_sub" onclick="return isSubmit()">提交</button>
  <button type="reset" class="btn btn-default" style="margin-left: 200px;">重置</button>
</form>
<script type="text/javascript">
$('input[name=desc]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=price]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=area]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=detail]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=contract]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
function isSubmit(){
if($('input[name=desc]').val()==""||$('input[name=price]').val()==""||$('input[name=area]').val()==""||$('input[name=detail]').val()==""||$('input[name=contract]').val()==""||$('input[name=file]').val()==""){
return false;
}
}
</script>
    </div>
    <!--二手精品-->








    <!--求购信息-->
    <div class="tab-pane fade" id="ios">
<form class="form-horizontal" role="form" action="publish/ask_buy" enctype="multipart/form-data" method="post">

 <div class="form-group" style="margin-left: 250px;">
    <label class="col-sm-2 control-label">商品类别</label>&nbsp;
    <select class="form-control col-sm-5" style="width: 500px;" name="kind">
      <option value="数码产品">数码产品</option>
      <option value="家用电器">家用电器</option>
      <option value="二手车">二手车</option>
      <option value="图书音像">图书音像</option>
      <option value="工艺收藏">工艺收藏</option>
      <option value="乐器运动">乐器运动</option>
    </select>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">商品描述</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control" placeholder="例：九成新的红米note4X" name="des">
    </div>
    <span class="red col-sm-2 control-label">描述不能为空</span>
  </div><br>


   <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">价格</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="1500" name="pric">
    </div>
    <span class="red col-sm-2 control-label">价格不能为空</span>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">地区</label>
    <select class="form-control" style="width: 500px;" name="are">
      <option value="桥西区">桥西区</option>
      <option value="裕华区">裕华区</option>
      <option value="长安区">长安区</option>
      <option value="桥东区">桥东区</option>
      <option value="新华区">新华区</option>
      <option value="正定区">正定区</option>
    </select>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">详细地址</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="例：裕翔街26号" name="detai">
    </div>
    <span class="red col-sm-2 control-label">地址不能为空</span>
  </div><br>


  <div class="form-group" style="margin-left: 250px;">
    <label  class="col-sm-2 control-label">联系方式</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="例：15732136925" name="contrac">
    </div>
    <span class="red col-sm-2 control-label" style="margin-left: -30px;">联系方式不能为空</span>
  </div><br>
  <button type="submit" class="btn btn-default" style="margin-left: 500px;" onclick="return istijiao()">提交</button>
  <button type="reset" class="btn btn-default" style="margin-left: 200px;">重置</button>
</form>
<script type="text/javascript">
$('input[name=des]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=pric]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=detai]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=contrac]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
function istijiao(){
if($('input[name=des]').val()==""||$('input[name=pric]').val()==""||$('input[name=detai]').val()==""||$('input[name=contrac]').val()==""){
return false;
}else{
  return true;
}
}
</script>
    </div>
    <!--求购信息-->







    <!--以物换物-->
    <div class="tab-pane fade" id="test">
  <form class="form-horizontal" role="form" method="post" action="publish/exchange" enctype="multipart/form-data">
   <div class="form-group" style="margin-left: 250px;">
    <label class="col-sm-2 control-label">商品类别</label>&nbsp;
    <select class="form-control col-sm-5" style="width: 500px;" name="ex_kind">
      <option value="数码产品">数码产品</option>
      <option value="家用电器">家用电器</option>
      <option value="二手车">二手车</option>
      <option value="图书音像">图书音像</option>
      <option value="工艺收藏">工艺收藏</option>
      <option value="乐器运动">乐器运动</option>
    </select>
  </div><br>
  <div class="form-group" style="margin-left: 250px;">
    <label for="firstname" class="col-sm-2 control-label">换品</label>
    <div class="col-sm-5" style="width: 517px;">
  <input type="text" class="form-control" placeholder="例：九成新的红米note4X" name="ex_desc">
    </div>
    <span class="red col-sm-2 control-label">换品不能为空</span>
  </div><br>

   <div class="form-group" style="margin-left: 250px;">
    <label for="lastname" class="col-sm-2 control-label">想换的物品</label>
    <div class="col-sm-5" style="width: 517px;">
<input type="text" class="form-control"  placeholder="1500" name="ex_product">
    </div>
    <span class="red col-sm-2 control-label" style="margin-left: -30px;">想换的物品不能为空</span>
  </div><br>

  <div class="form-group" style="margin-left: 250px;">
    <label for="name" class="col-sm-2 control-label">地区</label>
    <select class="form-control" style="width: 500px;" name="ex_area">
      <option value="桥西区">桥西区</option>
      <option value="裕华区">裕华区</option>
      <option value="长安区">长安区</option>
      <option value="桥东区">桥东区</option>
      <option value="新华区">新华区</option>
      <option value="正定区">正定区</option>
    </select>
  </div><br>

  <div class="form-group" style="margin-left: 250px;">
    <label class="col-sm-2 control-label">详细地址</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="例：裕翔街26号" name="ex_detail">
    </div>
<span class="red col-sm-2 control-label" style="margin-left: -30px;">详细地址不能为空</span>
  </div><br>

  <div class="form-group" style="margin-left: 250px;">
    <label for="lastname" class="col-sm-2 control-label">联系方式</label>
    <div class="col-sm-5" style="width: 517px;">
      <input type="text" class="form-control"  placeholder="例：15732136925" name="ex_contract">
    </div>
    <span class="red col-sm-2 control-label" style="margin-left: -30px;">联系方式不能为空</span>
  </div><br>

   <div class="form-group" align="center">
      <input type="file"  name="ex_pic">
  </div><br>

  <button type="submit" class="btn btn-default" style="margin-left: 500px;" onclick="return tijiao()" name="ex_sub">提交</button>
  <button type="reset" class="btn btn-default" style="margin-left: 200px;">重置</button>
</form>

<script type="text/javascript">
$('input[name=ex_desc]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=ex_product]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=ex_detail]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
$('input[name=ex_contract]').blur(function(){
  if($(this).val()==''){
       $(this).parent().next().show();
  }
})
function tijiao(){
   if($('input[name=ex_desc]').val()==""||$('input[name=ex_product]').val()==""||$('input[name=ex_detail]').val()==""||$('input[name=ex_contract]').val()==""||$('input[name=ex_pic]').val()==""){
   return false;
   }else{
  return true;
}
}
</script>
    </div>
    <!--以物换物-->
</div>


</body>
</html>